<?php #//AJAX PHP PENNY AUCTION v.1.1

#///////////////////////////////////////////////////////////
#//  COPYRIGHT 2009 Aaron Helmlinger ALL RIGHTS RESERVED  //
#///////////////////////////////////////////////////////////












include './includes/config.inc.php';

                   //echo "ergewrgwertwq34tq34twqergaerg";
                   
      $userid = $_POST['userid'];
   $itemid = $_POST['itemid'];
   $maxprice = $_POST['maxprice'];
   $maxbids = $_POST['maxbids'];
     $startprice = 0.00;                           //      echo $userid;
              //echo $itemid;
              //echo $maxprice;
              //echo $maxbids;
$num_auction = 0;

$query = "select * from PHPAUCTIONXL_proxybid
         WHERE itemid='$itemid' AND
         userid='$userid'";
$result = mysql_query($query);

        

$num_auction = mysql_num_rows($result);


if ( $num_auction == 1  ) {
$query2="UPDATE PHPAUCTIONXL_proxybid SET bid='$maxprice', proxybidqty='$maxbids' WHERE userid='$userid' AND itemid='$itemid'";
  // echo $query2; 
mysql_query($query2);

}



 if ( empty($num_auction) ) {
    //echo  $startprice; 
    mysql_query("INSERT INTO PHPAUCTIONXL_proxybid (itemid, userid, bid, startbid, proxybidqty) VALUES ('$itemid', '$userid', '$maxprice', '$startprice', '$maxbids')");
 
 
  // echo "234523523--------------------------";
}     



                           
include "view_all_live_auctions_phone2.php";


?>
